package formula;

import atom.UnaryAtom;
import literal.UnaryLiteral;

public class StarFormula extends UnaryFormula{
    //formula里增加一个有关*的类，进行通用匹配
    public StarFormula(){
        super(new UnaryLiteral(new UnaryAtom("*"), false));
    }

    //*与任意的literal之间equals。*与*也是equals。重写equals方法
//    char[] alphabet={'a','b','c','d','e','f','g',
//                     'h','i','j','k','l','m','n',
//                     'o','p','q','r','s','t',
//                     'u','v','w','x','y','z'};

    @Override
       public boolean equals(Object o){
        //这无论什么情况*都能进行匹配
        if(o instanceof Formula){
            return true;
        } else {return false;}
    }

    @Override
    public String toString() {
        return "*";
    }

    @Override
    public boolean isNegated(Formula f) {
        return true;
    }
    public StarFormula getNegated(){//对starf取反依然是starf
        return new StarFormula();
    }
}
